x11: be more verbose when glClientWaitSync behaves unexpectedtly
authorRay Strode <rstrode@redhat.com>
Mon, 22 Jun 2020 15:07:32 +0000 (11:07 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 22 Jun 2020 15:16:32 +0000 (11:16 -0400)
commit05736afaf8c1f934f72aec49c308acb2febd3bae
tree45099ffa69a0a368d1e22fb7bc9756d2a98c9184
parent8a91d1d1ce05b528b3db9188860f39829a96d348
x11: be more verbose when glClientWaitSync behaves unexpectedtly

When given a 0 timeout, glClientWaitSync is only supposed to return one
of three possible values:

 - GL_ALREADY_SIGNALED - fence fired
 - GL_WAIT_FAILED - there was an error
 - GL_TIMEOUT_EXPIRED - fence hasn't fired yet

In addition, it can also return GL_CONDITION_SATISFIED if a non-zero
timeout is passed, and the fence fires while waiting on the timeout.

Since commit 972134abe48a4c9c7b6ad41b0723f30f4e7ae16b we now call
glClientWaitSync (with a 0 timeout), but one user is reporting it's
returning some value that's not one of the above four.

This commit changes the g_assert to a g_error so we can see what
value is getting returned.

May help with https://gitlab.gnome.org/GNOME/gtk/-/issues/2858
gdk/x11/gdkglcontext-x11.c